﻿using Forum.Model.Validation;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace Forum.Model.Request
{
    public class UserInfoReq
    {
        /// <summary>
        /// 用户名
        /// </summary>
        [Required(ErrorMessage = "用户名必填")]
        [Chinese]
        [DisplayName("用户名")]
        public string UserName { get; set; }
        /// <summary>
        /// 昵称
        /// </summary>
        public string? NickName { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        [MinLength(6,ErrorMessage ="密码最小长度为6位")]
        [MaxLength(16,ErrorMessage ="密码最大长度为16位")]
        [EnglishNumberSymbol]
        [DisplayName("密码")]
        public string Password { get; set; }
        /// <summary>
        /// 电话
        /// </summary>
        public string? Tel { get; set; }
        /// <summary>
        /// 手机号
        /// </summary>
        [Validation.Phone]
        public string? Phone { get; set; }
        /// <summary>
        /// 地址
        /// </summary>
        public string? Address { get; set; }
        /// <summary>
        /// Email
        /// </summary>
        [EmailAddress(ErrorMessage = "Email格式错误")]
        public string? Email { get; set; }
        /// <summary>
        /// 头像
        /// </summary>
        public string Avatar { get; set; }
        /// <summary>
        /// 是否管理员
        /// </summary>
        public bool IsAdmin { get; set; }
    }
}
